package com.mobilepay.moneypig.model.dialog;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.mobilepay.moneypig.R;
import com.mobilepay.moneypig.base.BaseDialog;

/**
 * Created by xlm on 2017/9/21 0021
 */

public class VerifyDialog extends BaseDialog {
    public VerifyDialog(Context context) {
        super(context);
    }

    private EditText mEditPassword;
    private TextView mTextConfirm;
    private TextView mTextCancle;

    @Override
    protected void onSetContentView() {
        setContentView(R.layout.dialog_pay_confirm);
    }

    @Override
    protected void initViews() {
        mEditPassword = (EditText) findViewById(R.id.password_content);
        mTextConfirm = (TextView) findViewById(R.id.password_comfirm);
        mTextCancle = (TextView) findViewById(R.id.password_cancle);
        initWindow(0.75f, 0);
        setAnimate(R.style.animatedialog);
    }

    @Override
    protected void onSetListener() {
        mTextCancle.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                cancel();
            }
        });
        mTextConfirm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String editPs = mEditPassword.getText().toString();
                listener.onConfirm(editPs);
            }
        });
    }

    private PasswordDialog.Listener listener;

    public void setListener(PasswordDialog.Listener listener) {
        this.listener = listener;
    }

    public static class Listener {
        public void onConfirm(String ps) {

        }
    }


    @Override
    protected void afterOnCreate(Bundle savedInstanceState) {

    }
}
